n = int(input())

data = list(map(int,input().split()))

a,b = map(int,input().split())

s = 0
for i in range(a-1,b-1):
    s+= data[i]

print(s)